Skip to main content
Version: V4.0

Weather Service API


Get Weather by Country and City

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
countryStringBodyYesCountry
state_provinceStringBodyYesState or province
cityStringBodyYesCity

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
weatherStringBodyWeather type
sunny
cloudy
rainy
snowy
foggy
temperatureStringBodyTemperature (℃)
humidityStringBodyHumidity (%RH)
wind_speedStringBodyWind speed (m/s)
aqiStringBodyAir quality index

Request Example

POST /api/v1.0/invoke/open-ability/method/general-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "get_weather_by_country_and_city",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"country": "Brazil",
"state_province": "Bahia",
"city": "Rodelas"
}
}

Success Return Example

Status Code: 200

{
"success": true,
"timestamp": 1540869200562,
"result": {
"aqi": "19",
"humidity": "79",
"temperature": "21",
"weather": "sunny",
"wind_speed": "4.725265"
}
}

Failure Return Example

See Failure Return Example



Get Weather by Longitude and Latitude

Request URL

POST /api/v1.0/invoke/open-ability/method/general-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
latitudeStringBodyYesLatitude
longitudeStringBodyYesLongitude

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeTypeLocationLocationDescription
weatherStringStringBodyBodyWeather type
sunny
cloudy
rainy
snowy
foggy
temperatureStringStringBodyBodyTemperature (℃)
humidityStringStringBodyBodyHumidity (%RH)
wind_speedStringBodyBodyWind speed (m/s)Wind speed (m/s)
aqiStringBodyBodyAir quality indexAir quality index

Request Example

POST /api/v1.0/invoke/open-ability/method/general-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "get_weather_by_longitude_and_latitude",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"latitude": "-8.8508",
"longitude": "-38.7558"
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {
"aqi": "19",
"humidity": "79",
"temperature": "21",
"weather": "sunny",
"wind_speed": "4.725265"
}
}

Failure Return Example

See Failure Return Example